package com.huluobo.a2206parkdemo.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2206parkdemo.R
import com.huluobo.base.bean.SignBean
import com.huluobo.base.bean.SignBeanItem
import java.text.SimpleDateFormat
import java.util.Date

/**
 *  Created by LC on 2024/10/22.
 */
class SignAdapter : BaseQuickAdapter<SignBeanItem, BaseViewHolder>(R.layout.item_sign_month) {
    override fun convert(helper: BaseViewHolder, item: SignBeanItem) {
        helper.setText(R.id.item_sign_start_address_now_tv, item.startAddress)
        helper.setText(R.id.item_sign_end_address_now_tv, item.endAddress)

        val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
        val dateStart = Date(item.startTime)
        val startString = simpleDateFormat.format(dateStart)
        helper.setText(R.id.item_sign_start_time_now_tv, startString)

        val dateEnd = Date(item.endTime)
        val endString = simpleDateFormat.format(dateEnd)
        helper.setText(R.id.item_sign_end_time_now_tv, endString)
    }
}